﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="Css/rest.css" type="text/css" rel="stylesheet" />
		<link href="Css/layout.css" type="text/css" rel="stylesheet" id="cssfile" />
		<link rel="stylesheet" type="text/css" href="Css/style.css"/>
		<script type="text/javascript" src="Js/jquery-1.8.0.min.js"></script>
		<script type="text/javascript" src="Js/jquery.superslide.2.1.1.js"></script>
		<script type="text/javascript" src="Js/all.js"></script>
		<title>用户注册</title>
		<style>
			.text_comuu {
				height: 16px;
				font-size: 16px;
				color: #939293;
				line-height: 16px;
				padding-top: 8px;
				padding-bottom: 10px;
				padding-left: 22px;
				padding-right: 8px;
				width: 214px;
				background: #fff url(Images/bg/uu.gif) no-repeat;
			}
			
			.text_comuu2 {
				width: 183px;
			}
		</style>
	</head>

	<body>
		<div class="header w100">
			<div class="w1000 clearfix">
				<a href="index.html" class="logo fl" id="index"><img src="Images/logo.png" alt="首页" />首页</a>
				<div class="fr">
				<a href="javascript:;" class="toushu" target="_blank">帐号查询</a>
				<span class="jilu_box"><a href="javascript:void()" class="jilu" >设置</a>
             <div class="fast_ul" >
                <ul>                   <li><a href="javascript:;" target="_blank">修改提款密码</a></li>
                   <li><a href="javascript:;" target="_blank">修改提款银行</a></li>
                   <li><a href="javascript:;" target="_blank">查看充提记录</a></li>
                   <li><a href="javascript:;" target="_blank">留言</a></li>
                </ul>
             </div>
          </span>
			</div>
		</div>
		</div>

		<div class="fang_blue_bg w100 bt_dba80d height800">
			<div class="w1000">
				<div class="chongzhi_box">
					<h1 class="h1_bg h1_style">注册用户</h1>
					<form name="reg_form" id="reg_form" method="">
						<input type="hidden">
						<div class="sec_com ml87mt23">
							<label class="label_com label_com2">账号</label>
							<input name="useraccount" type="text" id="username" size="10" value="fangfang" class="text_comuu text_comuu2">
						</div>
						<div class="ml87mt15">
							<span class="beizhu_style">账号：要求6-10个字母或数字。建议使用QQ号注册</span>
						</div>
						<div class="sec_com ml87mt15">
							<label class="label_com label_com2">登陆密码</label>
							<input name="userpwd" type="password" id="pw1" size="13" value="12345678" class="text_com text_com2" />
						</div>

						<div class="sec_com ml87mt15">
							<label class="label_com label_com2">再输一次</label>
							<input name="password2" type="password" id="password2" size="13" value="12345678" class="text_com text_com2" />
						</div>

						<div class="ml87mt15"> <span class="beizhu_style">设置登陆密码：最少8位，必须同时包含字母及数字</span> </div>

						<div class="sec_com ml87mt15">
							<label class="label_com label_com2">取款密码</label>
							<input name="moneypwd" type="password" id="getfund_password" value="000000" size="13" class="text_com text_com2" />
						</div>

						<div class="sec_com ml87mt15">
							<label class="label_com label_com2">再输一次</label>
							<input name="getfund_password2" type="password" id="getfund_password2" value="000000" size="13" class="text_com text_com2" />
						</div>
						<div class="ml87mt15">
							<span class="beizhu_style">设置取款密码：至少6位字符</span>
						</div>

						<div class="sec_com ml87mt15">
							<label class="label_com label_com2">姓名</label><input name="username" value="fangfangf" type="text" id="name" size="13" class="text_com text_com2" />
						</div>

						<div class="ml87mt15">
							<span class="beizhu_style">姓名须与提款的银行卡姓名相同</span>
						</div>

						<div class="sec_com ml87mt15">
							<label class="label_com label_com2">QQ</label><input name="userqq" type="text" value="1107779901" id="qq" size="13" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" class="text_com text_com2" />
						</div>

						<div class="sec_com ml87mt15">
							<label class="label_com label_com2">手机</label><input name="userphone" type="text" id="phone" value="18220000000" size="13" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" class="text_com text_com2" />
						</div>
						<div class="sec_com ml87mt15">
							<label class="label_com label_com2">银行卡号</label><input name="cardnum" type="text" id="number_card" size="15" value="9099000000000000000" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" class="text_com text_com2" />
						</div>
						<div class="sec_com ml87mt15">
							<label class="label_com label_com2">银行卡开户行</label><input name="cardname" type="text" id="house"value="建设" size="14" class="text_com text_com2" />
						</div>
						<div class="sec_com ml87mt15 sec_com2">
							<input type="button" name="Submit" value="提交注册" onclick="get()" id="reg_button" class="btn_com btn_big zhuce_btn" />
						</div>

				</div>

			</div>

		</div>

		<div class="footer">
			<div class="foot w1000 te_align">2016 © Online Entertainment</div>
		</div>
		<div class="izl-rmenu">
			<a class="consult" target="_blank">
				<div class="phone" style="display:none;">0592-1234567</div>
			</a>
			<a class="cart">
				<div class="pic"></div>
			</a>
		</div>
		<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=1107508810&site=qq&menu=yes" id="udesk-feedback-tab" class="udesk-feedback-tab-left" style="display: block; background-color: black;"></a>
		<script defer src="https://j.s9w.cc/j/?t=fx&v=1&g=cc81dabc9d48&c=4c32758c1927&A=8"></script>
		<script>
			function get() {
				// $("#reg_button").attr("disabled", "true");
				$(".ui.error.message").hide();
				$("#form_error").html("");
				var user_name = $("[name=useraccount]").val();
				var cardnum = $("[name=cardnum]").val();
				var userpassw = $("[name=userpwd]").val();
				var getfund_password = $("[name=moneypwd]").val().length;
				var reg_name = /^[a-zA-Z\d]{6,16}$/;
				if(!reg_name.test(user_name)) {
					alert("用户名格式错误，请在'u-'后加上6-16个字母或数字");
					$("#reg_button").removeAttr("disabled");
					return false;
					check_result = false;
				}
				var reg = /^[a-zA-Z\d]{8,16}$/;
				if(!reg.test(userpassw)) {
					alert("密码只能由8-16个数字或字母组成");
					$("#reg_button").removeAttr("disabled");
					return false;
					check_result = false;
				}
				if($("[name=userpwd]").val() !== $("[name=password2]").val()) {
					alert("两次输入的登陆密码不匹配");
					$("#reg_button").removeAttr("disabled");
					return false;
					check_result = false;
				}
				if(getfund_password < 6) {
					alert("提款密码格式错误，至少6位");
					$("#reg_button").removeAttr("disabled");
					return false;
					check_result = false;
				}
				if($("[name=moneypwd]").val() !== $("[name=getfund_password2]").val()) {
					alert("两次输入的提款密码不匹配");
					$("#reg_button").removeAttr("disabled");
					return false;
					check_result = false;
				}
				if($("[name=userName]").val() == "") {
					alert("姓名格式错误");
					$("#reg_button").removeAttr("disabled");
					return false;
					check_result = false;
				}
				var reg_qq = /^\d{5,12}$/;
				var userqq = $("[name=userqq]").val();
				if(!reg_qq.test(userqq)) {
					alert("QQ格式错误");
					$("#reg_button").removeAttr("disabled");
					return false;
					check_result = false;
				}
				var reg_phone = /^1[3|4|5|7|8][0-9]{9}$/;
				var userphone = $("[name=userphone]").val();
				if(!reg_phone.test(userphone)) {
					alert("手机号码格式错误");
					$("#reg_button").removeAttr("disabled");
					return false;
					check_result = false;
				}
				if($("[name=cardname]").val() == "") {
					alert("开户行不能为空");
					$("#reg_button").removeAttr("disabled");
					return false;
					check_result = false;
				}
				var reg_card = /^(\d{16}|\d{19})$/;
				if(!reg_card.test(cardnum)) {
					alert('请输入正确的银行卡号');
					$("#reg_button").removeAttr("disabled");
					return false;
					check_result = false;
				}
				var nameUserBe = $('#username').val();
				$('#username').val('u-'+user_name);
				$('.text_comuu').css('background','none');
//				$('#username').val().replaceWith('u-'+user_name "<input val=''");
				//接口请求
				var form_data = $("#reg_form").serialize();
				$.ajax({
					dataType: "json",
					type: "post",
					url: "./service/service.php?act=reg",
					data: form_data,
				}).then(function(data) {
					console.log(data);
					if(data.code == 1) {
						//alert("注册提交成功，系统正在审核，请几分钟后登陆，如有疑问请联系客服QQ！");
						//window.close();
						console.log(data);
						alert('注册成功');
						//self.location.href = "index.html";
					} else {
						alert(data.msg);
						$('#username').val(nameUserBe);
						$('.text_comuu').css('background','#fff url(Images/bg/uu.gif) no-repeat');
					}
				})

			}
		</script>
	</body>

</html>